import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;


public class MenuAreaPanel extends JPanel {
	
	private static final int ButtonWidth = 100;
	private static final int ButtonHeight = 50;
	JButton Button1,Button2,Button3,Button4,Button5;
	
	
public MenuAreaPanel(){
	
		this.setLayout(new GridBagLayout());
		GridBagConstraints c = new GridBagConstraints();
	
		//make a listner called MAL contains mouse and action listners
		MenuAreaListener MAL = new MenuAreaListener(this);
	    this.addMouseListener(MAL);
	    
	    //basic set up
		this.setBackground(Color.white);
		this.setPreferredSize(new Dimension(100,700));
		 
		
		
		//adding buttons to he menu
        Button1 = new JButton("1");       //create a button
        c.weightx = 0.5;
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 0;
        c.gridy = 0;
        this.add(Button1, c);
        Button1.setPreferredSize(new Dimension(ButtonWidth, ButtonHeight));
        Button1.addActionListener(MAL);	//set listener to listen 
        Button1.setActionCommand("action");
        
        Button2 = new JButton("2");       //create a button
        c.fill = GridBagConstraints.HORIZONTAL;
    	c.weightx = 0.5;
    	c.gridx = 0;
    	c.gridy = 1;
    	Button2.setPreferredSize(new Dimension(ButtonWidth, ButtonHeight));
    	this.add(Button2, c); 			//position it     
        Button2.addActionListener(MAL);	//set listener to listen 
        Button2.setActionCommand("action2");
        
        Button3 = new JButton("3");       //create a button
        c.fill = GridBagConstraints.HORIZONTAL;
    	c.weightx = 0.5;
    	c.gridx = 0;
    	c.gridy = 2;
    	Button3.setPreferredSize(new Dimension(ButtonWidth, ButtonHeight));
    	this.add(Button3, c); 			//position it     
        Button3.addActionListener(MAL);	//set listener to listen 
        Button3.setActionCommand("action3");
        
        Button4 = new JButton("4");       //create a button
        c.fill = GridBagConstraints.HORIZONTAL;
    	c.weightx = 0.5;
    	c.gridx = 0;
    	c.gridy = 3;
    	Button4.setPreferredSize(new Dimension(ButtonWidth, ButtonHeight));
    	this.add(Button4, c); 			//position it     
        Button4.addActionListener(MAL);	//set listener to listen 
        Button4.setActionCommand("action4");
        
        Button5 = new JButton("5");       //create a button
        c.fill = GridBagConstraints.HORIZONTAL;
    	c.weightx = 0.5;
    	c.gridx = 0;
    	c.gridy = 4;
    	Button5.setPreferredSize(new Dimension(ButtonWidth, ButtonHeight));
    	this.add(Button5, c); 			//position it     
        Button5.addActionListener(MAL);	//set listener to listen 
        Button5.setActionCommand("action5");
        
        
        
        
		
	}
	
}
